import  re

# pattern = r'mr_\w+'   # 模式字符串
# string = 'MR_SHOP mr_shop'
# match = re.match(pattern,string ,re.I)
# print(match)
# string = '项目名称MR_SHOP mr_shop'
# match = re.match(pattern,string,re.I)
# print(match)



# pattern = r'mr_\w+'
# string = 'MR_SHOP mr_shop'
# match = re.match(pattern,string ,re.I)
# print('匹配值的起始位置:',match.start())
# print('匹配值的结束位置:',match.end())
# print('匹配位置的元组:',match.span())
# print('要匹配的字符:',match.string)
# print('匹配数据:',match.group())



# pattern = r'mr_\w+'   # 模式字符串
# string = 'MR_SHOP mr_shop'
# match = re.search(pattern,string ,re.I)
# print(match)
# string = '项目名称MR_SHOP mr_shop'
# match = re.search(pattern,string,re.I)
# print(match)



# pattern = r'mr_\w+'   # 模式字符串
# string = 'MR_SHOP mr_shop'
# match = re.findall(pattern,string ,re.I)
# print(match)
# string = '项目名称MR_SHOP mr_shop'
# match = re.findall(pattern,string)
# print(match)



# pattern = r'[1-9]{1,3}(\.[0-9]{1,3}){3}'
# string = '127.0.0.1   192.168.1.66'
# match = re.findall(pattern,string)
# print(match)


# pattern = r'([1-9]{1,3}(\.[0-9]{1,3}){3})'
# string = '127.0.0.1 192.168.1.66'
# match = re.findall(pattern,string)
# for item in match:
#     print(item[0])


# pattern=  r'1[34578]\d{9}'
# string = '中奖号码为84978981 联系方式:13611111111'
# result = re.sub(pattern,'1xxxxxxxxxxxx',string)
# print(result)

pattern = r'[?|&]'
url  = 'http://localhost:8080/myweb/index.aspx?username="mr"&pwd="woshi"'
result = re.split(pattern,url)
print(result)